.class public Lde/dealdoktor/app/activities/Splash;
.super Landroid/app/Activity;
.source "Splash.java"


# instance fields
.field private final SPLASH_DISPLAY_LENGTH:I


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 25
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 27
    const/16 v0, 0x3e8

    iput v0, p0, Lde/dealdoktor/app/activities/Splash;->SPLASH_DISPLAY_LENGTH:I

    .line 25
    return-void
.end method

.method private registerForPushNotifications()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 86
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.google.android.c2dm.intent.REGISTER"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 87
    .local v0, registrationIntent:Landroid/content/Intent;
    const-string v1, "app"

    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    invoke-static {p0, v3, v2, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 88
    const-string v1, "sender"

    const-string v2, "dealdoktorc2dm@gmail.com"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 89
    invoke-virtual {p0, v0}, Lde/dealdoktor/app/activities/Splash;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 90
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 11
    .parameter "icicle"

    .prologue
    const/4 v10, 0x0

    .line 31
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 32
    const v6, 0x7f030008

    invoke-virtual {p0, v6}, Lde/dealdoktor/app/activities/Splash;->setContentView(I)V

    .line 34
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    sput-object v6, Lde/dealdoktor/app/App;->categories:Ljava/util/ArrayList;

    .line 37
    const-string v6, "dealdoktor_preferences"

    invoke-virtual {p0, v6, v10}, Lde/dealdoktor/app/activities/Splash;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 41
    .local v4, settings:Landroid/content/SharedPreferences;
    :try_start_0
    const-string v6, "registrationKey"

    const-string v7, ""

    invoke-interface {v4, v6, v7}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 42
    .local v3, registrationId:Ljava/lang/String;
    const-string v6, ""

    invoke-virtual {v3, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    .line 43
    invoke-direct {p0}, Lde/dealdoktor/app/activities/Splash;->registerForPushNotifications()V

    .line 54
    :cond_0
    :goto_0
    const-string v6, "c2dm"

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "RegistrationId: "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v8, "registrationKey"

    const-string v9, ""

    invoke-interface {v4, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 61
    .end local v3           #registrationId:Ljava/lang/String;
    :goto_1
    new-instance v6, Landroid/os/Handler;

    invoke-direct {v6}, Landroid/os/Handler;-><init>()V

    new-instance v7, Lde/dealdoktor/app/activities/Splash$1;

    invoke-direct {v7, p0}, Lde/dealdoktor/app/activities/Splash$1;-><init>(Lde/dealdoktor/app/activities/Splash;)V

    .line 69
    const-wide/16 v8, 0x3e8

    .line 61
    invoke-virtual {v6, v7, v8, v9}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 72
    new-instance v2, Lcom/trademob/tracking/TMUniversalTracking;

    invoke-direct {v2, p0}, Lcom/trademob/tracking/TMUniversalTracking;-><init>(Landroid/content/Context;)V

    .line 74
    .local v2, myTracking:Lcom/trademob/tracking/TMUniversalTracking;
    invoke-virtual {v2}, Lcom/trademob/tracking/TMUniversalTracking;->trackAppload()V

    .line 76
    const-string v6, "Installations"

    const-string v7, ""

    invoke-virtual {v2, v6, v10, v7}, Lcom/trademob/tracking/TMUniversalTracking;->trackActionOnce(Ljava/lang/String;ILjava/lang/String;)V

    .line 79
    const-string v6, "appStarts"

    invoke-interface {v4, v6, v10}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v5

    .line 80
    .local v5, starts:I
    invoke-interface {v4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    .line 81
    .local v1, editor:Landroid/content/SharedPreferences$Editor;
    const-string v6, "appStarts"

    add-int/lit8 v5, v5, 0x1

    invoke-interface {v1, v6, v5}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 82
    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 83
    return-void

    .line 44
    .end local v1           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v2           #myTracking:Lcom/trademob/tracking/TMUniversalTracking;
    .end local v5           #starts:I
    .restart local v3       #registrationId:Ljava/lang/String;
    :cond_1
    :try_start_1
    const-string v6, "registrationIdSent"

    const/4 v7, 0x0

    invoke-interface {v4, v6, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v6

    if-nez v6, :cond_0

    .line 51
    invoke-static {p0, v3}, Lde/dealdoktor/app/data/DataModel;->sendRegistrationId(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 56
    .end local v3           #registrationId:Ljava/lang/String;
    :catch_0
    move-exception v0

    .line 57
    .local v0, e:Ljava/lang/Exception;
    const-string v6, "exception"

    const-string v7, "Splash onCreate"

    invoke-static {v6, v7, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 58
    const-string v6, "Fehler beim Initialisieren"

    const/4 v7, 0x1

    invoke-static {p0, v6, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    goto :goto_1
.end method
